//转化省标数据内容
var pageii = null;
var baseURL = "../../";
$(function () {
    $('.auditIssues').click(function () {
        $(this).hide()
        $("#u1261").show();
    })
    $('.reviewAndRectify').click(function () {
        $(this).hide()
        $("#u1238").show();
        $(".auditIssues").show();
        // reviewAndRectify()
    })


});
var options={
		fullscreenEl:false //关闭全屏按钮
	}
Vue.use(vuePhotoPreview,options);
var vm = new Vue({
    el: '#sqapp',
    data: {
    	dcfsMap: {1:'问题随拍', 2:'专项督察',3:'队伍管理',4:'执法执勤',5:'社会管控',6:'其他督察'},
    	modifyStatusMap:{0:'待整改',1:'无整改',2:'已整改',3:'备存无整改',4:'备存待整改'},
        id:'',
        roleId:$("#roleId").val(),
        dqDwId:$("#dqDwId").val(),
        questionModifyData:{},
    },
    mounted () {
        this.getQuestionModifyDetail();
        setTimeout(() => {
            vm.$previewRefresh()
        }, 2000);
    },

    methods: {
    	
    	getQuestionModifyDetail: function() {

    		let params = {
    			questionModifyId: $("#id").val(),
            }
    		let url = baseURL;
    		url = url +'business/supervisequestion/questionDetailInfo';
    		$.ajax({
                type: "GET",
                url: url,
                data:params,
                contentType: "application/json",
                success: function (res) {
                    if (res.code === '0') {
                    	debugger;
                    	vm.questionModifyData = res.questionList;
                    	for (let i=0; i < res.questionList.length; i++) {
                            let imageList = res.questionList[i].imageList;
                            let fkImageList = res.questionList[i].fkImageList;
                            var rootPath = $("#rootPath").val();
                            let videUrl = res.questionList[i].videoImage;
                            if (videUrl != undefined && videUrl != null && videUrl != '') {
                            	res.questionList[i].videoImage = rootPath + encodeURI(videUrl);
                            }
                            if (imageList != undefined && imageList != null && imageList != '') {
                            	 for (let j=0; j<imageList.length; j++) {
                                     let picUrl = imageList[j].picUrl;
                                     imageList[j].picUrl = rootPath + encodeURI(picUrl);
                                 }
                            }
                           
                            if (fkImageList != undefined && fkImageList != null && fkImageList != '') {
	                            for (let k=0; k<fkImageList.length; k++) {
	                                let picUrl = fkImageList[k].picUrl;
	                                fkImageList[k].picUrl = rootPath + encodeURI(picUrl);
	                            }
                            }
                        }
                    } else {
                        alert(res.msg);
                    }
                }
            });
    	},
    	playVideo (videoUrl){
            	    layer.open({
                        //title : "新增执行记录",
                        type : 2,
                        fixed: true,
                        shadeClose: true,
                        area : [ "600px", "400px" ],
                        content : baseURL + '/business/supervise/openVideo?url='+ encodeURI(videoUrl)
                    });
            	},
    	
    	//type=1 
    	checkQuestion (type, questionId, recordId, questionModifyId, questionDescription) {
    		//let questionId = $("#id").val();
    		//let recordId = recordId;
    		//let questionModifyId = questionModifyId;
    		debugger;
    		let url = '/business/supervise/questionOpen?questionId='+questionId + "&recordId=" +recordId + "&questionModifyId=" +questionModifyId + "&questionDescription=" +questionDescription + "&type=" +type;
            layer.open({
                //title : "新增执行记录",
                type : 2,
                fixed: true,
                shadeClose: true,
                area : [ "100%", "100%" ],
                content : baseURL + encodeURI(url)
            });
    	},
    	
    	closeWindow: function() {
    		parent.location.reload();
    	},
    
    }
    
    

});

